<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: admin_menu.php 14 2013-09-21 11:51:56Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 14 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:51:56 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

require ('includes/application_top.php');

if($_GET['action'] == 'save') {
	$post = $_POST;
	foreach ($post AS $key => $value) {
		$getID = explode('_', $key);
		if($getID[0] == 'pID')
			$db->db_query("UPDATE ".TABLE_ADMIN_MENU." SET parent_id = '".$value."' WHERE mID = '".$getID[1]."' ");
	}
	$message_stack->add_session('Die Menüzuweisungen wurde gespeichert.', 'success');
	redirect(href_link('admin_menu.php', 'action=edit_menu'));
	
} elseif ($_GET['action'] == 'save_edit_menu') {
	$konter = $db->db_query("SELECT mID FROM ".TABLE_ADMIN_MENU);
	
	while(!$konter->EOF) {
		$sql = array(	'sort_order' => $_POST['sort_order'][$konter->fields['mID']],
						'group_id' => $_POST['group_id'][$konter->fields['mID']],
						'parent_id' => $_POST['parent_id'][$konter->fields['mID']]);
		$db->db_perform(TABLE_ADMIN_MENU, $sql, 'update', "mID = '".$konter->fields['mID']."' ");
		$konter->MoveNext();
	}
	$message_stack->add_session('Die Einstellungen wurde gespeichert.', 'success');
	redirect(href_link('admin_menu.php?action=edit_all_menu'));

} elseif ($_GET['action'] == 'save_sort_order') {
	$post = $_POST;
	foreach ($post AS $key => $value) {
		$getID = explode('_', $key);
		$db->db_query("UPDATE ".TABLE_ADMIN_MENU." SET sort_order = '".$value."' WHERE mID = '".$getID[1]."' ");
	}
	$message_stack->add_session('Die Menüsortierung wurde gespeichert.', 'success');
	redirect(href_link('admin_menu.php'));

} elseif ($_GET['action'] == 'save_new_menu') {

	if(isset($_POST['is_menu']) && ($_POST['is_menu'] == 'yes')) {
		$db->db_query("INSERT INTO 
							".TABLE_ADMIN_MENU." 
								(parent_id,
								link,
								title_language_id_1) 
						VALUES 
							('".$_POST['parent_id']."',
							'0',
							'".$_POST['title_language_id_1']."')");
							
		$db->db_query("REPLACE INTO ".TABLE_ADMIN_ACCESS_RIGHTS." (file_name) VALUES ('".$_POST['title_language_id_1']."')");
		$message_stack->add_session('Der neue Men&uuml;punkt wurde erfolgreich gespeichert.', 'success');
		redirect(href_link('admin_menu.php?action=new_menu'));
		
	} elseif(file_exists(DIR_FS_ADMIN.$_POST['file_name'].'.php') && ($_POST['file_name'] != '')) {
		$checkMenu = $db->db_query("SELECT menu_name, group_id FROM ".TABLE_ADMIN_MENU." WHERE menu_name = '".$_POST['file_name']."' AND group_id = '".$_POST['group_id']."'");
		
		if(!$checkMenu->_numOfRows && ($_POST['file_name'] != 'configuration')) {
			$db->db_query("INSERT INTO ".TABLE_ADMIN_MENU." (menu_name, group_id, parent_id, link, title_language_id_1) VALUES ('".$_POST['file_name']."', '".(!empty($_POST['group_id'])?$_POST['group_id']:'0')."', '".$_POST['parent_id']."', '1', '".$_POST['title_language_id_1']."')");
			$db->db_query("INSERT INTO ".TABLE_ADMIN_ACCESS_RIGHTS." (file_name) VALUES ('".$_POST['file_name']."')");
			$message_stack->add_session('Der neue Men&uuml;punkt wurde erfolgreich gespeichert.', 'success');
			redirect(href_link('admin_menu.php?action=edit_menu'));
			
		} elseif($_POST['file_name'] == 'configuration' && !empty($_POST['group_id'])) {
			$message_stack->add_session('Der neue Men&uuml;punkt wurde erfolgreich gespeichert.', 'success');
			redirect(href_link('admin_menu.php?action=new_menu'));
			
		} else {
			$message_stack->add_session('Diese Datei wird bereits im Men&uuml; eingebunden', 'error');
			redirect(href_link('admin_menu.php?action=new_menu'));
		}
		
	} else {
		$message_stack->add_session('Die von Ihnen angegebene Datei existiert nicht!', 'error');
		redirect(href_link('admin_menu.php', 'action=new_menu'));
	}

} elseif($_GET['action'] == 'save_new_group') {
	$db->db_query("INSERT INTO ".TABLE_ADMIN_ACCESS_GROUPS." (group_name) VALUES ('".$_POST['new_group_name']."')");
	$insert_id = $db->db_insert_id();
	$db->db_query("UPDATE ".TABLE_ADMIN_ACCESS_GROUPS." SET agID = 'g_".$insert_id."' WHERE group_id = '".$insert_id."' ");
	$db->db_query("ALTER TABLE ".TABLE_ADMIN_ACCESS_RIGHTS." ADD g_".$insert_id." INT(1) NOT NULL DEFAULT '0'");
	
	redirect(href_link('admin_menu.php'));

} elseif ($_GET['action'] == 'save_rights') {

	$post = $_POST;
	
	$groups = $db->db_query("SELECT group_id, agID FROM ".TABLE_ADMIN_ACCESS_GROUPS);
	
	while(!$groups->EOF) {
	
		$admin_access = $db->db_query("SELECT menu_name, group_id FROM ".TABLE_ADMIN_MENU);
		
		while(!$admin_access->EOF) {
			if(strstr($admin_access->fields['menu_name'], 'configuration'))
				$admin_access->fields['menu_name'] = $admin_access->fields['menu_name'].'-'.$admin_access->fields['group_id'];
				
			$check = $db->db_query("SELECT file_name FROM ".TABLE_ADMIN_ACCESS_RIGHTS." WHERE file_name = '".$admin_access->fields['menu_name']."' ");
			
			if(in_array($admin_access->fields['menu_name'], $post['arID'][$groups->fields['group_id']])) {
				if($check->_numOfRows)
					$db->db_query("UPDATE ".TABLE_ADMIN_ACCESS_RIGHTS." SET ".$groups->fields['agID']." = '1' WHERE file_name = '".$admin_access->fields['menu_name']."' ");
				else
					$db->db_query("REPLACE INTO ".TABLE_ADMIN_ACCESS_RIGHTS." (file_name, ".$groups->fields['agID'].") VALUES ('".$admin_access->fields['menu_name']."', '1')");

			} else {
				if($check->_numOfRows)
					$db->db_query("UPDATE ".TABLE_ADMIN_ACCESS_RIGHTS." SET ".$groups->fields['agID']." = '0' WHERE file_name = '".$admin_access->fields['menu_name']."' ");
				else
					$db->db_query("REPLACE INTO ".TABLE_ADMIN_ACCESS_RIGHTS." (file_name, ".$groups->fields['agID'].") VALUES ('".$admin_access->fields['menu_name']."', '0')");
			}
			$admin_access->MoveNext();
		}
		$groups->MoveNext();
	}
	redirect(href_link('admin_menu.php', 'action=menu_rights'));
}

function getMenuDrop($parent_id = 0, $sep = '&nbsp;&nbsp;') {
	global $db, $drop;
	
	$data = $db->db_query("SELECT 
								mID, 
								parent_id, 
								title_language_id_".$_SESSION['languages_id']." 
							FROM
								".TABLE_ADMIN_MENU."
							WHERE
								parent_id = '".$parent_id."'
							AND
								link = '0'
							ORDER BY
								sort_order");
	if($data->_numOfRows) {
		if($parent_id == 0)
			$drop[] = array('id' => 0, 'text' => 'Top');

		while(!$data->EOF) {
				
			$drop[] = array('id' => $data->fields['mID'], 'text' => $sep.$data->fields['title_language_id_'.$_SESSION['languages_id']]);
			$check = $db->db_query("SELECT mID FROM ".TABLE_ADMIN_MENU." WHERE parent_id = '".$data->fields['mID']."'");
			
			if($check->_numOfRows)
				getMenuDrop($data->fields['mID'], $sep.'&nbsp;&nbsp;');
				
			$data->MoveNext();
		}
		return $drop;
	} else
		return;
	
}

if(isset($_GET['action']))
	$col_top .= '<a class="button" href="admin_menu.php?menu_id='.$_GET['menu_id'].'">Menu Sortierung</a> ';

if($_GET['action'] != 'edit_menu')
	$col_top .= '<a class="button" href="?action=edit_menu">Menu Zuweisung</a> ';

if($_GET['action'] != 'new_menu')
	$col_top .=' <a class="button" href="?action=new_menu">Neuer Men&uuml;punkt</a> ';

if($_GET['action'] != 'menu_rights')
	$col_top .=' <a class="button" href="?action=menu_rights">Men&uuml; Rechte</a> ';

if($_GET['action'] != 'new_menu_group')
	$col_top .=' <a class="button" href="?action=new_menu_group">Neue Benutzergruppe</a> ';

if($_GET['action'] != 'edit_all_menu')
	$col_top .=' <a class="button" href="?action=edit_all_menu">Men&uuml;punkt bearbeiten</a> ';

if($_GET['action'] == 'edit_menu' || $_GET['action'] == 'new_menu')
	$col_top .=' <a class="button" href="admin_menu.php?menu_id='.$_GET['menu_id'].'">zur&uuml;ck</a> ';


require(DIR_WS_INCLUDES.'metatag.php');
?>
<script type="text/javascript" src="includes/javascript/jquery.fixedTableHeader.js"></script>
<script type="text/javascript" src="includes/javascript/jquery.tallest.js"></script>
<script type="text/javascript">
<!--
	$(function() {
		$('.dataTable').fixedtableheader();
		var new_height = $('#menu_overview li.sub_items').tallestSize();
		$('#menu_overview li.sub_items').each(function(){
			$(this).height(new_height);
		});
		$('.is_menu_point').click(function(){
			if($(this).is(':checked')) {
				$('.language_name').css({'border': '1px solid #b20000'}).val($('.file_name').val()).focus();
				$('.file_name').attr("disabled","disabled").val('');
				$('.config_id').attr("disabled","disabled").val('');
			} else {
				$('.file_name').attr("disabled","");
				$('.language_name').css({'border': '1px solid #dfdfdf'});
			}
		});
		<?php if(isset($_GET['action']) && $_GET['action'] == 'menu_rights') { ?>
		$('.check_it').click(function(e){
			var id = $(this).attr('id');
			if($(this).is(':checked')) {
				$('.'+id+'_box').attr('checked', true);
			} else {
				$('.'+id+'_box').attr('checked', false);
			}
		});
		<?php } ?>
	});
//-->
</script>
<style type="text/css">
	#menu_overview {margin: 0 0 10px 0}
	#menu_overview li {float:left; margin: 0 10px 0 0; list-style:none; width: 200px}
	#menu_overview li ul {float:none; clear:both}
</style>
</head>
<body>
<?php require(DIR_WS_INCLUDES.'header.php'); ?>
<div id="wrapper">
	<table class="outerTable" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td valign="top" class="boxCenter">
	        	<table class="table_pageHeading" border="0" width="100%" cellspacing="0" cellpadding="0">
		   			<tr>
		     			<td class="pageHeading">AdminMen&uuml;-Verwaltung</td>
					</tr>
				</table>
	        	<table width="100%" ccellpadding="5">
		   			<tr>
		     			<td align="right" class="main"><?php echo $col_top; ?></td>
					</tr>
				</table><br />
				<?php
				if($_SESSION['customer_id'] == '1') {
					if($_GET['action'] == 'edit_menu') {
						echo draw_form('admin_menu', 'admin_menu.php', 'action=save', 'POST'); ?>
						<table width="100%" class="dataTable">
						<?php								
							$getSubMenuNames = $db->db_query("SELECT 
																mID AS mid, 
																title_language_id_".$_SESSION['languages_id']." AS menu_title
															FROM 
																".TABLE_ADMIN_MENU."
															WHERE
																link = '0'
															AND
																visible = '1'
															ORDER BY
																mID");
							
							if($getSubMenuNames->_numOfRows) {
								while(!$getSubMenuNames->EOF) {
									$menu[] = array('mid' => $getSubMenuNames->fields['mid'], 'title' => $getSubMenuNames->fields['menu_title']);
									$getSubMenuNames->MoveNext();
								}
							}					
													
							echo '<tr class="dataTableHeadingRow">
									<th class="dataTableHeadingContent">&nbsp;</th>';
							
								for($i = 0; $i < sizeof($menu); $i++) {
									echo '<th class="dataTableHeadingContent"><nobr>'.$menu[$i]['title'].'</nobr></th>';
								}
							
							echo '<th width="100%">&nbsp;</th></tr>';
							
							$numOfMenu = sizeof($menu);
							
							$sub_array = $menu;
							
							foreach($menu AS $mID => $m) {
								$getSites = $db->db_query("SELECT
																mID,
																parent_id,
																title_language_id_".$_SESSION['languages_id']."
															FROM
																".TABLE_ADMIN_MENU."
															WHERE
																visible = '1'
															AND
																parent_id = '".$m['mid']."'
															AND
																link = '1'
															ORDER BY
																title_language_id_".$_SESSION['languages_id']);
								while(!$getSites->EOF) { $rows++;
									if ($rows % 2 == 0)
							    		$f = 'dataTableRow';
							    	else
							    		$f = '';
									echo '<tr class="'.$f.'" onmouseover="this.className=\'dataTableRowOver\';" onmouseout="this.className=\''.$f.'\'">';
									echo '	<td><nobr>'.$getSites->fields['title_language_id_'.$_SESSION['languages_id']].'</nobr></td>';
									foreach($sub_array AS $menu_ID => $mi) {
										echo '	<td align="center">
													<input type="radio"';
													if($getSites->fields['parent_id'] == ($mi['mid']))
														echo ' checked="" ';
										echo 			'name="pID_'.$getSites->fields['mID'].'" value="'.($mi['mid']).'" />
												</td>';
									}
									$getSites->MoveNext();
									echo '<td width="100%">&nbsp;</td></tr>';
								}
							}
						?>
						</table>
						<button type="submit" class="button"><?php echo BUTTON_SAVE; ?></button>
					</form>
				<?php
					} elseif ($_GET['action'] == 'new_menu') {
						echo '<table width="100%">';
						echo '	<td valign="top" width="49%">';
						echo 	draw_form('admin_menu', 'admin_menu.php', 'action=save_new_menu', 'POST');
						echo '	<table cellpadding="8">
									<tr colspan="2"><h3>Neuer Men&uuml;-Eintrag</h3></tr>
									<tr>
										<td valign="top">
											Name der Datei<br />
											<em>Bsp: <b>modul_xy</b>.php</em>
										</td>
										<td>
											<input type="text" name="file_name" class="file_name" size="40" />
										</td>
									</tr>
									<tr>
										<td valign="top">
											Konfigdatei?<br />
											<em>Bsp: configuration.php?gID=<b>123</b></em>
										</td>
										<td>
											<input type="text" name="group_id" size="40" class="config_id" />
										</td>
									</tr>
									<tr>
										<td valign="top">
											In welches Men&uuml;?
										</td>
										<td>';
						echo 				draw_pull_down_menu('parent_id', getMenuDrop());
						echo 			'</td>
									</tr>';
						echo 		'<tr>
										<td>Menü-Überschrift?</td>
										<td><input name="is_menu" type="checkbox" value="yes" class="is_menu_point" /></td>
									</tr>';
						echo 		'<tr>
										<td valign="top">
											Name des Men&uuml;punktes<br />
											<em>kurz und Aussagekräftig</em>
										</td>
										<td>
											<input type="text" class="language_name" name="title_language_id_1" size="40" />
										</td>
									</tr>
									<tr><td>&nbsp;</td><td><button type="submit" class="button">'.BUTTON_SAVE.'</button></td></tr>
								</table>';
						echo '</form></td>';
						echo '	</tr>';
						echo '</table';

					} elseif($_GET['action'] == 'menu_rights') { ?>
						<?php echo draw_form('admin_menu', 'admin_menu.php', 'action=save_rights', 'POST'); ?>
						<table width="100%" class="dataTable">
							<tr class="dataTableHeadingRow">
								<td class="dataTableHeadingContent"><?php echo TEXT_ACCESS; ?></td>
								<?php
								$fields = $db->db_query("SELECT * FROM ".TABLE_ADMIN_ACCESS_RIGHTS);

								foreach($fields->fields AS $key => $value) {

									if(strstr($key, 'g_')) {
										$groups[] = $key;

										$data = $db->db_query("SELECT file_name, ".$key." FROM ".TABLE_ADMIN_ACCESS_RIGHTS);
										while (!$data->EOF) {
											$id = explode('_', $key);
											$rights[$id[1]][$data->fields['file_name']] = $data->fields[$key];
											$data->MoveNext();
										}
									}
									$fields->MoveNext();
								}

								foreach ($groups AS $group) {
									if ($field !='file_name') {
										$getGroupeName = $db->db_query("SELECT group_name FROM ".TABLE_ADMIN_ACCESS_GROUPS." WHERE agID = '".$group."'");

										if($field != 'file_name') {
											echo '<td class="dataTableHeadingContent" nowrap>
													<nobr><input class="check_it" type="checkbox" name="check_all_'.$group.'" value="" id="'.$group.'" />
													'.$getGroupeName->fields['group_name'].'</nobr>
												</td>';
										}
									}
								}

								echo '<td class="dataTableHeadingContent">&nbsp;</td>';
								?>
							</tr>
								<?php
									$admin_access = $db->db_query("SELECT 
																		menu_name, 
																		group_id, 
																		link, 
																		title_language_id_".(int)$_SESSION['languages_id']." 
																	FROM 
																		".TABLE_ADMIN_MENU."
																	WHERE
																		link != '0'");

									while(!$admin_access->EOF) {

										if(strstr($admin_access->fields['menu_name'], 'configuration'))
											$admin_access->fields['menu_name'] = $admin_access->fields['menu_name'].'-'.$admin_access->fields['group_id'];
										echo '<tr>';
										echo '<td class="dataTableContentRow" width="1">
												<nobr>'.
													$admin_access->fields['title_language_id_'.(int)$_SESSION['languages_id']].' ('.$admin_access->fields['menu_name'].')
												</nobr>
											</td>';
											
										foreach($groups AS $group) { $i++;

											$grp_id = explode('_', $group);

											echo '	<td align="center" width="1" class="dataTableContentRow">																				<input type="checkbox" class="'.$group.'_box" name="arID['.$grp_id[1].'][]"';
											if($rights[$grp_id[1]][$admin_access->fields['menu_name']] == '1')
												echo ' checked="" ';

											echo 'value = "'.$admin_access->fields['menu_name'].'" />
													</td>';
										}
										echo '<td class="dataTableContentRow" width="100%">&nbsp;</td>';
										echo '</tr>';
										$admin_access->MoveNext();
									}
								?>
						</table>
						<button type="submit" class="button"><?php echo BUTTON_SAVE; ?></button>
						</form>
					<?php
					} elseif ($_GET['action'] == 'new_menu_group'){
						echo draw_form('admin_menu', 'admin_menu.php', 'action=save_new_group', 'POST');
						echo '	<table cellpadding="8">
									<tr>
										<td>Gruppenname:</td>
										<td><input type="text" value="" name="new_group_name" /></td>
									</tr>
								</table>';
						echo '	<button type="submit" class="button">'.BUTTON_SAVE.'</button>';
						echo '</form>';
						
					} elseif ($_GET['action'] == 'edit_all_menu') {
							
						echo draw_form('admin_menu', 'admin_menu.php', 'action=save_edit_menu', 'POST');
												
						$get_menu = $db->db_query("SELECT 
														mID,
														parent_id,
														group_id,
														menu_name,
														sort_order,
														visible,
														link,
														title_language_id_".$_SESSION['languages_id']." 
													FROM
														".TABLE_ADMIN_MENU);
														
						$menu_drop = getMenuDrop();
						echo '	<button type="submit" class="button">'.BUTTON_SAVE.'</button>';
						echo '	<table cellpadding="8" class="dataTable" align="center">
									<tr class="dataTableHeadingRow">
										<th class="dataTableHeadingContent">ID</th>
										<th class="dataTableHeadingContent">Men&uuml;name</th>
										<th class="dataTableHeadingContent">Reihung</th>
										<th class="dataTableHeadingContent">Übergeordneter Menüpunkt</th>
										<th class="dataTableHeadingContent">Gruppen-ID</th>
									</tr>';
									while(!$get_menu->EOF) {
										echo '	<tr>';
										echo '		<td align="center" width="1">'.($get_menu->fields['link'] == 1 ? $get_menu->fields['mID'] : '').'</td>';
										echo '		<td>'.
														($get_menu->fields['link'] == 0 ? '<b>'.$get_menu->fields['title_language_id_'.$_SESSION['languages_id']].'</b>' : $get_menu->fields['title_language_id_'.$_SESSION['languages_id']])
													.'</td>';
										echo '		<td align="center">
														<input style="text-align:center" size="3" type="text" value="'.$get_menu->fields['sort_order'].'" name="sort_order['.$get_menu->fields['mID'].']" />
													</td>';
										echo '		<td>
														'.draw_pull_down_menu('parent_id['.$get_menu->fields['mID'].']', $menu_drop, $get_menu->fields['parent_id']).'
													</td>';
										echo '		<td align="center">
														<input style="text-align:center" size="3" type="text" value="'.$get_menu->fields['group_id'].'" name="group_id['.$get_menu->fields['mID'].']" />
													</td>';
										echo '	</tr>';
										$get_menu->MoveNext();
									}
						echo '	</table>';
						echo '	<button type="submit" class="button">'.BUTTON_SAVE.'</button>';
						echo '</form>';
					
					} else {
						
						echo draw_form('admin_menu', 'admin_menu.php', 'action=save_sort_order', 'POST');
						echo '<br /><div style="text-align:right"><button type="submit" class="button">Sortierungen '.BUTTON_SAVE.'</button></div><br />';
					
						function getMenuItemsAdmin($parent_id = 0) {
							global $db;
							$getMenuLinksAdmin = $db->db_query("SELECT
																	title_language_id_".$_SESSION['languages_id'].",
																	mID,
																	link,
																	sort_order
																FROM
																	".TABLE_ADMIN_MENU."
																WHERE
																	parent_id = '".$parent_id."'
																AND
																	visible = '1'
																ORDER BY
																	sort_order");
							if($getMenuLinksAdmin->_numOfRows) {
								while(!$getMenuLinksAdmin->EOF) {
									if($parent_id == 0)
										$menuAdmin .= '	<ul id="menu_overview">';
									else	
										$menuAdmin .= '	<ul>';
										
									if($getMenuLinksAdmin->fields['link'] == '0' && $parent_id == 0) {
										$menuAdmin .= '	<li class="sub_item">';
										$menuAdmin .= 		'<b>'.$getMenuLinksAdmin->fields['title_language_id_'.$_SESSION['languages_id']].'</b>';
										$menuAdmin .= 		getMenuItemsAdmin($getMenuLinksAdmin->fields['mID']);
										$menuAdmin .= '	</li>';
										
									} elseif($getMenuLinksAdmin->fields['link'] == '0' && $parent_id > 0) {
										$menuAdmin .= '	<li>
															<input style="text-align:center" name="mID_'.$getMenuLinksAdmin->fields['mID'].'" type="text" size="3" value="'.$getMenuLinksAdmin->fields['sort_order'].'" /> <b>'.$getMenuLinksAdmin->fields['title_language_id_'.$_SESSION['languages_id']].'</b>';
										$menuAdmin .= 		getMenuItemsAdmin($getMenuLinksAdmin->fields['mID']);
										$menuAdmin .= '	</li>';
										
									} elseif($getMenuLinksAdmin->fields['link'] == '1') {
										$menuAdmin .= '	<li>';
										$menuAdmin .= '		<input style="text-align:center" name="mID_'.$getMenuLinksAdmin->fields['mID'].'" type="text" size="3" value="'.$getMenuLinksAdmin->fields['sort_order'].'" /> ';
										$menuAdmin .= 		$getMenuLinksAdmin->fields['title_language_id_'.$_SESSION['languages_id']];
										$menuAdmin .= 		getMenuItemsAdmin($getMenuLinksAdmin->fields['mID']);
										$menuAdmin .= '	</li>';
									}
									$menuAdmin .= '	</ul>';
									$getMenuLinksAdmin->MoveNext();
								}
								return $menuAdmin;
							} else
								return;
						}
						echo getMenuItemsAdmin();
						echo '</form>';
					}
				} else
					echo NOT_ALLOWED_TO_SEE;
				?>
			</td>
		</tr>
	</table>
</div>
<?php require(DIR_WS_INCLUDES.'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES.'application_bottom.php');